#!/usr/bin/python

import cv2
import sys

if len(sys.argv) < 2:
    # with no arguments, use this default file
    filename = "/home/tutorial/Tutorial/Data/movie.mov"
elif len(sys.argv) == 2:
    filename = sys.argv[1]
else:
    sys.exit("Expecting a single video file argument")


movie = cv2.VideoCapture(filename)
while True:
    valid_frame, image = movie.read()
    if not valid_frame:
        break

    # Insert code here to process the image before displaying it

    cv2.imshow('Exercise 3: OpenCV', image)
    cv2.waitKey(5)

cv2.destroyAllWindows()
